/*
 * ImageUtils.java - Copyright Apr 16, 2012 Z Networks Group, Inc. All rights reserved.
 * Z Networks Group PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.andromeda.skadi.view.swing;

import java.awt.Image;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.UIManager;

/**
 *
 * @author Dickinson Roman Arismendy Torres
 */
public class ImageUtils {
    
    public static Icon getQuestionIcon(int width, int height){
        return getIcon(width, height, "OptionPane.questionIcon");
    }
    public static Icon getErrorIcon(int width, int height){
        return getIcon(width, height, "OptionPane.errorIcon");
    }
    public static Icon getInfoIcon(int width, int height){
        return getIcon(width, height, "OptionPane.informationIcon");
    }
    public static Icon getWarningIcon(int width, int height){
        return getIcon(width, height, "OptionPane.warningIcon");
    }
    
    private static Icon getIcon(int width, int height, String id){
        Image img = ((ImageIcon)UIManager.getIcon(id)).getImage();
        Image newimg = img.getScaledInstance(width, height, java.awt.Image.SCALE_SMOOTH);
        ImageIcon newIcon = new ImageIcon(newimg);
        return newIcon;
    }
    
}
